/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Euclidian;

import Filters.Kalman3;
import Filters.MWA;
import Transformers.BSS;
import Transformers.BaselineWonder;
import Transformers.Fourier;

/**
 *
 * @author Gebruiker
 */
public class Euclidian {
    
    public double distance(double [][] original, double[][] toCompare){
        double distance = 0;
        for (int i = 0; i < original.length; i++) {
            for (int j = 0; j < original[i].length; j++) {
                distance+=Math.abs(original[i][j] - toCompare[i][j]);
            }
        }
        return distance/(original.length*original[0].length);
    }
    
    
    public double[][] generateSignals(double[][] source, double a){
        BaselineWonder bw = new BaselineWonder();
        return bw.init(a, source);   
    }
    public void calculateValues(double[][] source){
        BSS bss = new BSS();
        Kalman3 km = new Kalman3();
        
        //BSS comparison
        double [][] bssSignal;
        bssSignal = bss.preWhiten(source);
        bssSignal = bss.BSS(bssSignal, 50);
        
        
        //MWA comparison
        double [][] mwa = new double [source.length][source[0].length];
        for (int i = 0; i < source.length; i++) {
            mwa[i] = MWA.normal(source[i], 10, 10);
        }
        mwa = bss.preWhiten(mwa);
        mwa = bss.BSS(mwa, 20);
        
        //MWM comparison
        double [][] mwm = new double [source.length][source[0].length];
        for (int i = 0; i < source.length; i++) {
            mwm[i] = MWA.median(source[i], 10, 10);
        }
        mwm = bss.preWhiten(mwm);
        mwm = bss.BSS(mwm, 20);
        
        //MWG comparison
        double [][] mwg = new double [source.length][source[0].length];
        for (int i = 0; i < source.length; i++) {
            mwg[i] = MWA.gaussian(source[i], 10, 10);
        }
        mwg = bss.preWhiten(mwg);
        mwg = bss.BSS(mwg, 20);
        
    }
    
}
